readme
* do files and data files: STATA 16
To replicate the tables in "Judging Under Public Pressure" run the main do file: "Analysis RESTAT Nov 2021.do"

The main do file uses the following three do files:
"creating standing_diff RESTAT Nov 2021.do"
* creating measures for the importance of the game from data of the position of the temans (teams' standing)
"imputation guest fans RESTAT.do"
* imputing away fans
"Tables 2 6 and 7 RESTAT Nov 2021.do"
* this do file is run from the main do file to create Tables 2, 6 and 7 (the structure of the data for these table is such that for each game there are two rows: one for errors and yellow cards of the home team and the other for the away team. For the rest of the tables: 3, 4, and 5 -- the data is such that for each game there are four rows: two for the home team and two for the away team -- where each team has information about yellow cards for the period before and after [error/half of the game].

In each one of the do files there are explaintion of what these do files do.

These do files use the following STATA datasets:
dataset_RESTAT.dta
standings_RESTAT.dta

The data we use is extracted from publicly available match summaries at www.wahretabelle.de, from the German Football Association’s website, the Kicker website www.kicker.de, and the website www.fussballmafia.de.
A detailed explanation of the sources of the data can be found in the paper in Chapter 3.


Dictionary of variables in dataset_RESTAT
=========================================
division - two divisions in the Bundesliga [1 & 2] 
season - data includes games from 2009 (9) - 2020 (20)
matchday - 34 matches in a season 
hteam_id - name of home team
ateam_id - name of away team
minute - the minute in the game when the event happened
minute_extra - 1 if there were extra minutes
event - type of event (goal, yellow card, red card etc.)
event_club_id - the team in charge of the event
player1 - player responsible for the event
goal_type - type of goal
mistake - dummy for a mistake
mistake order - sequence of mistakes
wt_event - whether there was a false goal or missed goal
result - the results of the game (score for home team : score for away team)
results_wt - the results with wt_event
date - date of game
location - location of game
spectators - number of spectators in stadium
guest fans reported fans of the away team
distance distance between home and away team
h(a)_standing - home (away) position in the table at the current game
h(a)_wins - home (away) number of wins so far at the current game
h(a)_draws - h(a)_goals_against - measures of some statistics of the home (away) team so far.
advantage_hteam - equal 1 if the mistake benefited home team
advantage_hteam - equal 1 if the mistake benefited away team
advantage - whether the event if for the advantage of the hometeam (1) or the awayteam (2).
mistakes - number of mistakes in a game
adv_h - number of mistakes in game benefiting home team
adv_a - number of mistakes in game benefiting away team
VAR - equal 1 for games with Video Assistant Referees
no_spectators - eqaul 1 for games with no spectators
year
hgolas - total number of goals to the home team
agoals - total number of goals to the away team
hteam_standing_last_seaon - the standing home team in the last seaons
ateam_standing_last_seaon - the standing away team in the last seaons
day - the day of the week
capacity - the capacity of the stadium
stadium_name
runningtrack - whether there is running track in the stadium
refed_games - number of games the referee referred
ref_dob_day(month)[year] - the referee day(month)[year] of boyrth
ref_home_town
ref_home_verband - referee home team
job - referee jov
ref_height(weight) - referee height(weight)
h_ & a_ -- statistics of the game played

